﻿@inject getData getData

<!DOCTYPE html>
@{ var user = Context.Session.Keys.Contains("user") ? Context.Session.getValue<WqUser>("LoginUser") : null;}
<html>
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>魏清风水算命论坛</title>
    <link href="~/css/layout_mobile.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="~/plugins/My97DatePicker/WdatePicker.js"></script>

    <script type="text/javascript">

        $(function () {
            $("body").css("height", window.screen.availHeight);
            $("#main_content").css("min-height", window.screen.availHeight - 70);

            var imgs = $("#main_content p img");
            if (imgs.length > 0) {
                for (var i = 0; i < imgs.length; i++) {
                    var img = $(imgs.get(i));
                    if (img.width() > img.parent().width()) {
                        img.removeAttr("style");
                    }
                }
            }
        })

        // 显示菜单
        function showmenu() {
            if ($("#menu").is(":hidden")) {
                $("#menu").show();
            } else {
                $("#menu").hide();
            }
        }

        // 隐藏菜单
        function hidemenu() {
            $("#menu").hide();
        }

    </script>
</head>
<body>

    @*头部*@
    <div style="background-color:#533535;height:50px;width:100%;padding-top:20px;">
        &emsp;
        <svg onclick="showmenu()" aria-hidden="true" class="octicon octicon-three-bars" height="24" version="1.1" viewBox="0 0 12 16" width="18">
            <path fill-rule="evenodd" d="M11.41 9H.59C0 9 0 8.59 0 8c0-.59 0-1 .59-1H11.4c.59 0 .59.41.59 1 0 .59 0 1-.59 1h.01zm0-4H.59C0 5 0 4.59 0 4c0-.59 0-1 .59-1H11.4c.59 0 .59.41.59 1 0 .59 0 1-.59 1h.01zM.59 11H11.4c.59 0 .59.41.59 1 0 .59 0 1-.59 1H.59C0 13 0 12.59 0 12c0-.59 0-1 .59-1z"></path>
        </svg>
        &emsp; @{ if (user != null) { <text>欢迎您,@user.NickName</text>}}
        <div style="float:right;"><a href="/index_m/index" style="color:aliceblue;">首页</a> &emsp;</div>
        @*菜单*@
        <div id="menu" style="display:none;width:100%;background-color:#EAE2D5;position:relative;">
            <ul>
                <li><a href="/index_m/ApplyYuce">申请预测</a></li>
                <li><a href="/index_m/titleList">查看帖子</a> </li>
                <li><a href="/index_m/liuyan">我要留言</a></li>
                <li><a href="/index_m/ycList">预测文章</a></li>
                
                @{
                    var cateDic = getData.getCategoryDic();
                    if (cateDic != null && cateDic.Values.Count > 0)
                    {
                        foreach (var item in cateDic.Values)
                        {
                            <li><a href="/index_m/artList?cateid=@item.id">@item.category_name</a></li>
                        }
                    }
                }

                <li><a href="/index_m/about">关于</a></li>
                @{if (user == null) {<li><a href="/index_m/login">登录</a></li>}else{<li><a href="/index_m/logout">注销</a></li>} }
            </ul>
        </div>
    </div>

    <div id="main_content" onclick="hidemenu()">
        @RenderBody()
    </div>
</body>
</html>
